#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

# Set PVR350 Output to Composite
v4l2-ctl --set-output 1

# Set Power Governor to "POWERSAVE" (for quieter operation)

modprobe p4_clockmod
modprobe cpufreq_conservative
modprobe cpufreq_ondemand
modprobe cpufreq_powersave
modprobe cpufreq_stats
modprobe cpufreq_userspace
cpufreq-set -g powersave

# Start LIRC IREXEC Daemon
su media -c "screen -dmS irexec /usr/local/bin/irexec.start"

# Start LIRC XEVENT Daemon
#screen -dm irxevent /etc/lirc/irxeventrc

# Start Bemused Bluetooth MPD Bridge
su media -c "screen -dmS pbmpcd /usr/local/bin/pbmpcd.py"

# Restore Audio
alsactl restore

exit 0
